﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace Web.Extensions
{
    using ECommon.IO;
    using ENode.Commanding;
    using QueryServices;
    using Infrastructure;
    using Web.Services;

    /// <summary>
    /// 控制器基类，备用
    /// </summary>
    public class BaseController : Controller
    {
        //private readonly IAuthenticationService _authenticationService;
        //private readonly ICommandService _commandService; 
        //private readonly IAccountQueryService _queryService;
        
        //// 并非所有的页面都需要发送命令，尤其是查询服务，一个控制器有那么一二个就够用了，不需要取得所有的查询接口

        //public BaseController(IAuthenticationService authenticationService, 
        //    ICommandService commandService, 
        //    IAccountQueryService queryService)
        //{
        //    _authenticationService = authenticationService;
        //    _commandService = commandService;
        //    _queryService = queryService;
        //}

        ///// <summary>异步发送给定的命令
        ///// </summary>
        ///// <param name="command"></param>
        ///// <param name="millisecondsDelay"></param>
        ///// <returns></returns>
        //private Task<AsyncTaskResult> SendCommandAsync(ICommand command, int millisecondsDelay = 5000)
        //{
        //    return _commandService.SendAsync(command).TimeoutAfter(millisecondsDelay);
        //}
    }
}